package it.webrules.deploymanager.core.st.scm;

import it.webrules.deploymanager.core.OperationResult;

import java.io.File;

/**
 * 
 * Interface for any SCM Connector.
 * SCM can support tags and/or branch.
 * 
 * 
 * @author dometec
 *
 */
public interface SCMConnector {

	/**
	 * List "trunk" and all tags and branches of this project that a working copy can switch.  
	 * 
	 * @return
	 * @throws SCMException
	 */
	SwitchableDirs getSwitchableDirs() throws SCMException;

	/**
	 * Checkout a copy of repository
	 * 
	 * @throws SCMException
	 */
	OperationResult checkout(Type type, String name, Boolean forcecheckout) throws SCMException;

	Info info() throws SCMException;

	OperationResult cleanup() throws SCMException;

	Object status() throws SCMException;

	Object diff() throws SCMException;

	OperationResult revert() throws SCMException;

	OperationResult update() throws SCMException;

	OperationResult switchTo(Type type, String name) throws SCMException;

	OperationResult delete(Type type, String name) throws SCMException;

	Object log() throws SCMException;

	OperationResult createCompleteGraph(File outsvgfile) throws SCMException;

	OperationResult createSimpleGraph(File graphOutputFile) throws SCMException;

	String getNextTagVersion() throws SCMException;

	OperationResult copy(Type srctype, String srcname, Type dsttype, String dstname) throws SCMException;

}